#include <stdio.h>
#include <ctype.h>

int main(void) {
    int i, count[26] = {0};
    char ch;
    printf("输入一行，以回车结束:\n");
    while ((ch = getchar()) != '\n') {
        ch = tolower(ch);    /*若ch是大写字母则转换为小写字母*/
        if (islower(ch))       /*若ch小写字母*/
            count[ch - 'a']++;  /*字符ch的次数count[ch-‘a’]增1*/
    }
    for (i = 0; i < 26; i++) {
        if (count[i] != 0)
            printf("count of %c is %d\n", i + 'a', count[i]);
    }
    return 0;
}
